[Services] List invoices for a service engagement
curl --request GET \
--url https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"count": 123,
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legacy_id": 123,
"invoice_number": "<string>",
"issue_date": "2023-12-25",
"due_date": "2023-12-25",
"subtotal": "<string>",
"tax_amount": "<string>",
"total": "<string>",
"tax_rate": "<string>",
"tax_country": "<string>",
"is_reverse_charge": true,
"paid_at": "2023-11-07T05:31:56Z",
"amount_paid": "<string>",
"refunded_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"credit": "<string>",
"pdf_file": "<string>",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"unit_price": "<string>",
"subtotal": "<string>",
"type": "<string>",
"quantity": "<string>",
"taxed": true,
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": "<unknown>"
}
],
"payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legacy_id": 123,
"amount": "<string>",
"currency": "<string>",
"payment_method": {},
"paid_at": "2023-11-07T05:31:56Z",
"created": "2023-11-07T05:31:56Z"
}
],
"balance_transactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legacy_id": 123,
"amount": "<string>",
"balance_before": "<string>",
"balance_after": "<string>",
"created": "2023-11-07T05:31:56Z"
}
],
"promo_code_usages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promo_code_name": "<string>",
"discount_amount": "<string>",
"created": "2023-11-07T05:31:56Z"
}
],
"orders": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legacy_id": 123,
"legacy_order_number": "<string>",
"order_date": "2023-11-07T05:31:56Z",
"amount": "<string>",
"currency": "<string>",
"payment_gateway_name": "<string>",
"created": "2023-11-07T05:31:56Z"
}
],
"billing_info": {
"billing_name": "<string>",
"billing_email": "jsmith@example.com",
"company_name": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"vat_number": "<string>",
"vat_validated": true
},
"created": "2023-11-07T05:31:56Z",
"modified": "2023-11-07T05:31:56Z",
"currency": "<string>",
"notes": "<string>"
}
],
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2"
}Services
[Services] List invoices for a service engagement
GET
/
v1
/
organizations
/
{organization_id}
/
services
/
{id}
/
invoices
[Services] List invoices for a service engagement
curl --request GET \
--url https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onetsolutions.net/v1/organizations/{organization_id}/services/{id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"count": 123,
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legacy_id": 123,
"invoice_number": "<string>",
"issue_date": "2023-12-25",
"due_date": "2023-12-25",
"subtotal": "<string>",
"tax_amount": "<string>",
"total": "<string>",
"tax_rate": "<string>",
"tax_country": "<string>",
"is_reverse_charge": true,
"paid_at": "2023-11-07T05:31:56Z",
"amount_paid": "<string>",
"refunded_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"credit": "<string>",
"pdf_file": "<string>",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"unit_price": "<string>",
"subtotal": "<string>",
"type": "<string>",
"quantity": "<string>",
"taxed": true,
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": "<unknown>"
}
],
"payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legacy_id": 123,
"amount": "<string>",
"currency": "<string>",
"payment_method": {},
"paid_at": "2023-11-07T05:31:56Z",
"created": "2023-11-07T05:31:56Z"
}
],
"balance_transactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legacy_id": 123,
"amount": "<string>",
"balance_before": "<string>",
"balance_after": "<string>",
"created": "2023-11-07T05:31:56Z"
}
],
"promo_code_usages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promo_code_name": "<string>",
"discount_amount": "<string>",
"created": "2023-11-07T05:31:56Z"
}
],
"orders": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legacy_id": 123,
"legacy_order_number": "<string>",
"order_date": "2023-11-07T05:31:56Z",
"amount": "<string>",
"currency": "<string>",
"payment_gateway_name": "<string>",
"created": "2023-11-07T05:31:56Z"
}
],
"billing_info": {
"billing_name": "<string>",
"billing_email": "jsmith@example.com",
"company_name": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"vat_number": "<string>",
"vat_validated": true
},
"created": "2023-11-07T05:31:56Z",
"modified": "2023-11-07T05:31:56Z",
"currency": "<string>",
"notes": "<string>"
}
],
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2"
}Authorizations
Use Authorization: Bearer <token> header. Token can be a JWT token or an API key (format: sk-onetsolutions-...).
Path Parameters
Service engagement ID
Unique identifier of the organization
⌘I

